<?php


namespace partner\functions\wechat\lib\SaleInfo;

use partner\functions\wechat\lib\BaseWechatPartner;
use Exception;

class MpInfo extends BaseWechatPartner
{
    protected $upload_properties = [
        'mp_pics' => 5
    ];

    // 服务商公众号AppID
    public $mp_appid = '';

    // 商家公众号AppID
    public $mp_sub_appid = '';

    // 公众号页面截图
    public $mp_pics = [];

    public function setMpAppId(string $mp_appid = '')
    {
        $this->mp_appid = $mp_appid;
        return $this;
    }

    public function setMpSubAppId(string $mp_sub_appid = '')
    {
        $this->mp_sub_appid = $mp_sub_appid;
        return $this;
    }

    public function setMpPics(array $mp_pics = [])
    {
        if (empty($mp_pics))
            throw new Exception("公众号缩略图不能为空");
        $this->mp_pics = $mp_pics;
        return $this;
    }
}